//
//  ProgressViewController.swift
//  UI
//
//  Created by admin on 14/9/22.
//  Copyright (c) 2014年 sinosun. All rights reserved.
//

/*
enum UIProgressViewStyle : Int {
case Default // normal progress bar
case Bar // for use in a toolbar
}

@availability(iOS, introduced=2.0)
class UIProgressView : UIView, NSCoding {

init(progressViewStyle style: UIProgressViewStyle) // sets the view height according to the style

var progressViewStyle: UIProgressViewStyle // default is UIProgressViewStyleDefault

var progress: Float // 0.0 .. 1.0, default is 0.0. values outside are pinned.

@availability(iOS, introduced=5.0)
var progressTintColor: UIColor?
@availability(iOS, introduced=5.0)
var trackTintColor: UIColor?

@availability(iOS, introduced=5.0)
var progressImage: UIImage?
@availability(iOS, introduced=5.0)
var trackImage: UIImage?

@availability(iOS, introduced=5.0)
func setProgress(progress: Float, animated: Bool)
}


*/
import UIKit

class ProgressViewController: UIViewController {
    @IBOutlet var progeressView: UIProgressView!
    

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
       // self.progeressView.progressViewStyle = UIProgressViewStyle.Bar
        self.progeressView.progressTintColor = UIColor.redColor()
        self.progeressView.trackTintColor = UIColor.grayColor()
        self.progeressView.progress = 0.0

        
       // NSThread.sleepForTimeInterval(2.0)
       // self.progeressView.progress = 1.0
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    @IBAction func begin(sender: AnyObject) {
                for i in 1...1000000{
                    self.progeressView.progress = (Float)(i / 1000000)
                }
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
